Skip to content
This repository was archived by the owner on Jun 26, 2022. It is now read-only.

Upgrading Tokio for 0.2.0, adding examples with actix and actix-web#11

Merged
Rufflewind merged 2 commits intoRufflewind:masterfrom
dangerousplay:tokio-0.2
Nov 29, 2020
Merged

Upgrading Tokio for 0.2.0, adding examples with actix and actix-web#11
Rufflewind merged 2 commits intoRufflewind:masterfrom
dangerousplay:tokio-0.2

Conversation

@dangerousplay
Copy link
Copy Markdown

  • Removing old examples.

@Rufflewind
Copy link
Copy Markdown
Owner

Thanks for the PR! It seems tokio has native support for files nowadays. Is there still a use case for this library?

@WGH-
Copy link
Copy Markdown

WGH- commented Sep 13, 2020

Yes, tokio::fs::File doesn't seem to handle EAGAIN, so reading such file returns a WouldBlock error instead of proper "blocking" through the event loop.

@Rufflewind
Copy link
Copy Markdown
Owner

Yes, tokio::fs::File doesn't seem to handle EAGAIN, so reading such file returns a WouldBlock error instead of proper "blocking" through the event loop.

Could this issue be resolved upstream?

@WGH-
Copy link
Copy Markdown

WGH- commented Sep 19, 2020

In theory yes. However, given that the issue essentially asking for this is stalled, it's not clear whether they want to include it in the main crate: tokio-rs/tokio#2558

As an example from another language, Go runtime automatically detects that the file is non-blocking and uses the runtime poller: golang/go@ea5825b

This updates the example output, tests/run, and the golden tests/*.txt.

Also, the stdin_actix_web example will now automatically exit when the
stdin future terminates to prevent the test from hanging.
@Rufflewind Rufflewind merged commit f496b40 into Rufflewind:master Nov 29, 2020
@Rufflewind
Copy link
Copy Markdown
Owner

Thanks for the pull request!

@WGH-
Copy link
Copy Markdown

WGH- commented Dec 9, 2020

FWIW, tokio 0.3 has tokio::io::unix::AsyncFd, which looks like direct replacement.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants